<template>
	<view class="wrap">
		<view class="top"></view>
		<view class="content">

			<view class="title" style="text-align: center;">欢迎登录科院公共安全平台</view>
			<u-form :model="form" ref="uForm">
				<u-form-item label="学号" prop="form.userId" label-width='120'>
					<u-input type="number" v-model="form.userId" />
				</u-form-item>
				<u-form-item label="密码" prop="form.password" label-width='120'>
					<u-input v-model="form.password" type="password" />
				</u-form-item>
			</u-form>
			<view style="height: 30rpx;"></view>
			<view>
			</view>
			<view style="height: 30rpx;clear:both"></view>
			<u-button @click="submit">登录</u-button>
		</view>
		<u-toast :type="type" ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				icon: true,
				position: 'center',
				form: {
					userId: '1',
					password: '123456'
				},
				rules: {
					userId: [{
						required: true,
						message: '请输入学号',
						trigger: ['blur', 'change']
					}],
					password: [{
						required: true,
						message: '请输入密码',
						trigger: ['blur', 'change']
					}]
				},
			}
		},
		onReady() {
			this.$refs.uForm.setRules(this.rules);
		},
		computed: {
			inputStyle() {
				let style = {};
				if (this.tel) {
					style.color = "#fff";
					style.backgroundColor = this.$u.color['warning'];
				}
				return style;
			}
		},
		methods: {
		 	submit() {
				this.axios.post("http://localhost:8080/front/user/login").then((response) => {
				  console.log(response.data)
				})
			},
			Merchant() {
				this.$u.route({
					url: 'pages/index/Merchant_login'
				})
			},
			//登录暂定

		}
	};

</script>

<style lang="scss" scoped>
	.wrap {
		font-size: 28rpx;

		.content {
			width: 600rpx;
			margin: 80rpx auto 0;

			.title {
				text-align: left;
				font-size: 60rpx;
				font-weight: 500;
				margin-bottom: 100rpx;
			}

			input {
				text-align: left;
				margin-bottom: 10rpx;
				padding-bottom: 6rpx;
			}

			.tips {
				color: $u-type-info;
				margin-bottom: 60rpx;
				margin-top: 8rpx;
			}

			.getCaptcha {
				background-color: rgb(253, 243, 208);
				color: $u-tips-color;
				border: none;
				font-size: 30rpx;
				padding: 12rpx 0;

				&::after {
					border: none;
				}
			}

			.alternative {
				color: $u-tips-color;
				display: flex;
				justify-content: space-between;
				margin-top: 30rpx;
			}
		}

		.buttom {
			.loginType {
				display: flex;
				padding: 350rpx 150rpx 150rpx 150rpx;
				justify-content: space-between;

				.item {
					display: flex;
					flex-direction: column;
					align-items: center;
					color: $u-content-color;
					font-size: 28rpx;
				}
			}

			.hint {
				padding: 20rpx 40rpx;
				font-size: 20rpx;
				color: $u-tips-color;

				.link {
					color: $u-type-warning;
				}
			}
		}
	}
</style>
